using System;


namespace Handrise.Mobile.BasicModal.Serialization.Attributes
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct
         | AttributeTargets.Delegate)]
    public class CustomSerializableAttribute : System.Attribute
    {

        private bool customSerializable;
        private Type surrogate;
        private Type overrideSerialization;

        public Type OverrideSerialization
        {
            get { return overrideSerialization; }
            set { overrideSerialization = value; }
        }

        public Type Surrogate
        {
            get { return surrogate; }
            set { surrogate = value; }
        }

        /// <summary>
        /// This property is a named parameter used to select custom serialization:
        /// If it's set to true, then the object is self-serializable and must
        /// use custom serialization.
        /// It's false by default.
        /// </summary>
        public bool Custom
        {
            get { return customSerializable; }
            set { customSerializable = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        public CustomSerializableAttribute()
        {
            this.surrogate = null;
            this.overrideSerialization = null;
            this.Custom = false;
        }
    }
}
